{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 7,
   "id": "da419500",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Not an odd minute\n"
     ]
    }
   ],
   "source": [
    "from datetime import datetime\n",
    "\n",
    "odds = [1,3,5,7,9,11,13,15,17,19,21,23,25,27,29,31,33,35,37,39,41,43,45,47,49,51,53,57,59]\n",
    "\n",
    "right_this_minute = datetime.today().minute\n",
    "\n",
    "if right_this_minute in odds:\n",
    "    print(\"This minute seems a little odd.\")\n",
    "else:\n",
    "    print(\"Not an odd minute\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "id": "0da81a20",
   "metadata": {},
   "outputs": [],
   "source": [
    "from datetime import datetime\n",
    "#从pythin基础库中找到datetime模块"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "id": "7aa68e1d",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "datetime.datetime(2021, 9, 12, 23, 42, 59, 704164)"
      ]
     },
     "execution_count": 8,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "datetime.today()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "d1e3db7c",
   "metadata": {},
   "outputs": [],
   "source": [
    "#调用标准库中的模块功能\n",
    "time_now = datetime.today()\n",
    "right_this_minute = time_now.minute"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 11,
   "id": "91ed2727",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "so sad!\n"
     ]
    }
   ],
   "source": [
    "if right_this_minute == 'Saturday':\n",
    "    print('happy！')\n",
    "elif right_this_minute == 'Sunday':\n",
    "    print('Recover.')\n",
    "else:\n",
    "    print('so sad!')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "e6c9ca80",
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "hide_input": false,
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.8.8"
  },
  "toc": {
   "base_numbering": 1,
   "nav_menu": {},
   "number_sections": true,
   "sideBar": true,
   "skip_h1_title": false,
   "title_cell": "Table of Contents",
   "title_sidebar": "Contents",
   "toc_cell": false,
   "toc_position": {},
   "toc_section_display": true,
   "toc_window_display": false
  },
  "varInspector": {
   "cols": {
    "lenName": 16,
    "lenType": 16,
    "lenVar": 40
   },
   "kernels_config": {
    "python": {
     "delete_cmd_postfix": "",
     "delete_cmd_prefix": "del ",
     "library": "var_list.py",
     "varRefreshCmd": "print(var_dic_list())"
    },
    "r": {
     "delete_cmd_postfix": ") ",
     "delete_cmd_prefix": "rm(",
     "library": "var_list.r",
     "varRefreshCmd": "cat(var_dic_list()) "
    }
   },
   "types_to_exclude": [
    "module",
    "function",
    "builtin_function_or_method",
    "instance",
    "_Feature"
   ],
   "window_display": false
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
